<template>
	<view class="content">
		<view class="text-area">
			<text class="title" >{{title}}{{cont}}</text>
		</view>
		<!-- 监听事件获取子组件的传值 -->
		<test :ss="msg" @sendData='getData'></test>
		<testa></testa>
		<testb></testb>
	</view>
</template>

<script>
	import test from '../../components/test.vue'
	import testA from '../../components/a.vue'
	import testB from '../../components/b.vue'
	
	export default {
		data() {
			return {
				title: 'Hello',
				msg:'baba你真厉害',
				cont:"",
			}
		},
		// 注册组件
		components:{
			test:test,
			testa:testA,
			testb:testB,
		},
		onLoad() {

		},
		methods: {
			getData(res){
				console.log('监听事件',res)
				this.cont = res
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
